package cn.com.open.itembank.common.enums;

/**
 * Created by lucky on 2017/7/17.
 */

/**
 * 状态描述
 */
public enum SysState {
    /**
     * 启用（默认）
     */
    START(0),
    /**
     * 禁用
     */
    STOP(1),
    /**
     * 删除
     */
    DELETE(-1),
    /**
     * 系统停用
     */
    CLOSE(9);

    private Integer index;

    SysState(Integer idx) {
        this.index = idx;
    }

    /**
     * Gets index.
     *
     * @return the index
     */
    public Integer getIndex() {
        return index;
    }

    public static SysState fromValue(Integer v) {
        for (SysState c : SysState.values()) {
            if (c.getIndex() == v) {
                return c;
            }
        }
        return null;
    }
}
